package teatime.core.model.entity.base;

import java.lang.Comparable;
import java.io.Serializable;


/**
 * This is an object that contains data related to the account table.
 * Do not modify this class because it will be overwritten if the configuration file
 * related to this class is modified.
 *
 * @hibernate.class
 *  table="account"
 */

public abstract class BaseAccount  implements Comparable, Serializable {

	public static String REF = "Account";
	public static String PROP_ACCOUNT_TYPE_ID = "AccountTypeId";
	public static String PROP_ACCOUNT_STATUS_ID = "AccountStatusId";
	public static String PROP_ACCOUNT_MOBIL_TELEPHONE = "AccountMobilTelephone";
	public static String PROP_ACCOUNT_STATUS_DETAIL_ID = "AccountStatusDetailId";
	public static String PROP_ACCOUNT_CREATE_DATE = "AccountCreateDate";
	public static String PROP_ACCOUNT_PERSON = "AccountPerson";
	public static String PROP_ACCOUNT_TYPE_DETAIL_ID = "AccountTypeDetailId";
	public static String PROP_ACCOUNT_PASSWORD = "AccountPassword";
	public static String PROP_ACCOUNT_NAME = "AccountName";
	public static String PROP_ID = "Id";
	public static String PROP_ACCOUNT_EMAIL = "AccountEmail";


	// constructors
	public BaseAccount () {
		initialize();
	}

	/**
	 * Constructor for primary key
	 */
	public BaseAccount (java.lang.Integer id) {
		this.setId(id);
		initialize();
	}

	/**
	 * Constructor for required fields
	 */
	public BaseAccount (
		java.lang.Integer id,
		java.lang.String accountName,
		java.lang.String accountPassword,
		java.util.Date accountCreateDate,
		java.lang.String accountStatusId,
		java.lang.String accountTypeId,
		java.lang.String accountStatusDetailId,
		java.lang.String accountTypeDetailId) {

		this.setId(id);
		this.setAccountName(accountName);
		this.setAccountPassword(accountPassword);
		this.setAccountCreateDate(accountCreateDate);
		this.setAccountStatusId(accountStatusId);
		this.setAccountTypeId(accountTypeId);
		this.setAccountStatusDetailId(accountStatusDetailId);
		this.setAccountTypeDetailId(accountTypeDetailId);
		initialize();
	}

	protected void initialize () {}



	private int hashCode = Integer.MIN_VALUE;

	// primary key
	private java.lang.Integer id;

	// fields
	private java.util.Date accountCreateDate;
	private java.lang.String accountEmail;
	private java.lang.String accountMobilTelephone;
	private java.lang.String accountName;
	private java.lang.String accountPassword;
	private java.lang.String accountStatusDetailId;
	private java.lang.String accountStatusId;
	private java.lang.String accountTypeDetailId;
	private java.lang.String accountTypeId;

	// many to one
	private teatime.core.model.entity.Person accountPerson;

	// collections
	private java.util.Set<teatime.core.model.entity.Person> persons;



	/**
	 * Return the unique identifier of this class
     * @hibernate.id
     *  generator-class="native"
     *  column="ACCOUNT_ID"
     */
	public java.lang.Integer getId () {
		return id;
	}

	/**
	 * Set the unique identifier of this class
	 * @param id the new ID
	 */
	public void setId (java.lang.Integer id) {
		this.id = id;
		this.hashCode = Integer.MIN_VALUE;
	}




	/**
	 * Return the value associated with the column: ACCOUNT_CREATE_DATE
	 */
	public java.util.Date getAccountCreateDate () {
		return accountCreateDate;
	}

	/**
	 * Set the value related to the column: ACCOUNT_CREATE_DATE
	 * @param accountCreateDate the ACCOUNT_CREATE_DATE value
	 */
	public void setAccountCreateDate (java.util.Date accountCreateDate) {
		this.accountCreateDate = accountCreateDate;
	}



	/**
	 * Return the value associated with the column: ACCOUNT_EMAIL
	 */
	public java.lang.String getAccountEmail () {
		return accountEmail;
	}

	/**
	 * Set the value related to the column: ACCOUNT_EMAIL
	 * @param accountEmail the ACCOUNT_EMAIL value
	 */
	public void setAccountEmail (java.lang.String accountEmail) {
		this.accountEmail = accountEmail;
	}



	/**
	 * Return the value associated with the column: ACCOUNT_MOBIL_TELEPHONE
	 */
	public java.lang.String getAccountMobilTelephone () {
		return accountMobilTelephone;
	}

	/**
	 * Set the value related to the column: ACCOUNT_MOBIL_TELEPHONE
	 * @param accountMobilTelephone the ACCOUNT_MOBIL_TELEPHONE value
	 */
	public void setAccountMobilTelephone (java.lang.String accountMobilTelephone) {
		this.accountMobilTelephone = accountMobilTelephone;
	}



	/**
	 * Return the value associated with the column: ACCOUNT_NAME
	 */
	public java.lang.String getAccountName () {
		return accountName;
	}

	/**
	 * Set the value related to the column: ACCOUNT_NAME
	 * @param accountName the ACCOUNT_NAME value
	 */
	public void setAccountName (java.lang.String accountName) {
		this.accountName = accountName;
	}



	/**
	 * Return the value associated with the column: ACCOUNT_PASSWORD
	 */
	public java.lang.String getAccountPassword () {
		return accountPassword;
	}

	/**
	 * Set the value related to the column: ACCOUNT_PASSWORD
	 * @param accountPassword the ACCOUNT_PASSWORD value
	 */
	public void setAccountPassword (java.lang.String accountPassword) {
		this.accountPassword = accountPassword;
	}



	/**
	 * Return the value associated with the column: ACCOUNT_STATUS_DETAIL_ID
	 */
	public java.lang.String getAccountStatusDetailId () {
		return accountStatusDetailId;
	}

	/**
	 * Set the value related to the column: ACCOUNT_STATUS_DETAIL_ID
	 * @param accountStatusDetailId the ACCOUNT_STATUS_DETAIL_ID value
	 */
	public void setAccountStatusDetailId (java.lang.String accountStatusDetailId) {
		this.accountStatusDetailId = accountStatusDetailId;
	}



	/**
	 * Return the value associated with the column: ACCOUNT_STATUS_ID
	 */
	public java.lang.String getAccountStatusId () {
		return accountStatusId;
	}

	/**
	 * Set the value related to the column: ACCOUNT_STATUS_ID
	 * @param accountStatusId the ACCOUNT_STATUS_ID value
	 */
	public void setAccountStatusId (java.lang.String accountStatusId) {
		this.accountStatusId = accountStatusId;
	}



	/**
	 * Return the value associated with the column: ACCOUNT_TYPE_DETAIL_ID
	 */
	public java.lang.String getAccountTypeDetailId () {
		return accountTypeDetailId;
	}

	/**
	 * Set the value related to the column: ACCOUNT_TYPE_DETAIL_ID
	 * @param accountTypeDetailId the ACCOUNT_TYPE_DETAIL_ID value
	 */
	public void setAccountTypeDetailId (java.lang.String accountTypeDetailId) {
		this.accountTypeDetailId = accountTypeDetailId;
	}



	/**
	 * Return the value associated with the column: ACCOUNT_TYPE_ID
	 */
	public java.lang.String getAccountTypeId () {
		return accountTypeId;
	}

	/**
	 * Set the value related to the column: ACCOUNT_TYPE_ID
	 * @param accountTypeId the ACCOUNT_TYPE_ID value
	 */
	public void setAccountTypeId (java.lang.String accountTypeId) {
		this.accountTypeId = accountTypeId;
	}



	/**
	 * Return the value associated with the column: ACCOUNT_PERSON_ID
	 */
	public teatime.core.model.entity.Person getAccountPerson () {
		return accountPerson;
	}

	/**
	 * Set the value related to the column: ACCOUNT_PERSON_ID
	 * @param accountPerson the ACCOUNT_PERSON_ID value
	 */
	public void setAccountPerson (teatime.core.model.entity.Person accountPerson) {
		this.accountPerson = accountPerson;
	}



	/**
	 * Return the value associated with the column: Persons
	 */
	public java.util.Set<teatime.core.model.entity.Person> getPersons () {
		return persons;
	}

	/**
	 * Set the value related to the column: Persons
	 * @param persons the Persons value
	 */
	public void setPersons (java.util.Set<teatime.core.model.entity.Person> persons) {
		this.persons = persons;
	}

	public void addToPersons (teatime.core.model.entity.Person person) {
		if (null == getPersons()) setPersons(new java.util.TreeSet<teatime.core.model.entity.Person>());
		getPersons().add(person);
	}





	public boolean equals (Object obj) {
		if (null == obj) return false;
		if (!(obj instanceof teatime.core.model.entity.Account)) return false;
		else {
			teatime.core.model.entity.Account account = (teatime.core.model.entity.Account) obj;
			if (null == this.getId() || null == account.getId()) return false;
			else return (this.getId().equals(account.getId()));
		}
	}

	public int hashCode () {
		if (Integer.MIN_VALUE == this.hashCode) {
			if (null == this.getId()) return super.hashCode();
			else {
				String hashStr = this.getClass().getName() + ":" + this.getId().hashCode();
				this.hashCode = hashStr.hashCode();
			}
		}
		return this.hashCode;
	}

	public int compareTo (Object obj) {
		if (obj.hashCode() > hashCode()) return 1;
		else if (obj.hashCode() < hashCode()) return -1;
		else return 0;
	}

	public String toString () {
		return super.toString();
	}


}